package com.neuronbit.businessflow.runtime.repo;

import com.neuronbit.businessflow.runtime.exec.*;

import java.sql.SQLException;

public interface BusinessFlowRepository {
    ExecutedFlowInstance findExecutedFlowInstance(String flowTypeName, String key) throws SQLException;

    void initAndLock(ExecutedFlowInstance instance) throws SQLException;

    void updateFlowExecutionByExecutionId(ExecutedFlowInstance instance, FlowExecutionStatus originalStatus, LockStatus originalLockStatus) throws SQLException;

    void saveStepExecution(ExecutedStepInstance instance) throws SQLException;

    void updateStepExecutionByExecutionId(ExecutedStepInstance instance, StepExecutionStatus originalStatus) throws SQLException;
}
